<%--
  Created by IntelliJ IDEA.
  User: sunhao
  Date: 2015/10/8 0008
  Time: 上午 11:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>

<html>
<head>
    <title>学生信息</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <%--<script>--%>
        <%--$(function () {--%>
            <%--$("#registerTime").text(cxDate('YYYY-MM-DD', '${user.registerTime}'))--%>
        <%--})--%>
    <%--</script>--%>
    <%--<link href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">--%>
    <link href="/static/bui/css/bs3/dpl.css" rel="stylesheet" type="text/css"/>
    <link href="/static/bui/css/bs3/bui.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="container">
    <div class="detail-page">
        <h2>学生信息</h2>

        <div class="detail-section">
            <h3>基本信息</h3>

            <div class="row detail-row">
                <div class="span8">
                    <label>学生姓名：</label><span class="detail-text">${student.name}</span>
                </div>
                <div class="span8">
                    <label>电话：</label><span class="detail-text">${student.phone}</span>
                </div>
                <%--<div class="span8">--%>
                    <%--<label>注册时间：</label><span class="detail-text" id="registerTime"></span>--%>
                <%--</div>--%>
                <div class="span8">
                    <label>身份证号：</label><span class="detail-text">${student.identityCard}</span>
                </div>
            </div>
            <div class="row detail-row">
                <div class="span16">
                    <label id="lessons">所学课程：</label>
                    <span class="detail-text">
                        <c:forEach items="${student.lesson}" var="pr">
                            ${pr.name},
                        </c:forEach>
                    </span>
                </div>

                <div class="span8">
                    <label id="teachers">任课教师：</label>
                    <span class="detail-text">
                        <c:forEach items="${student.teacher}" var="pr">
                            ${pr.name},
                        </c:forEach>
                    </span>
                </div>
            </div>

            <input type="button" value="返回学生列表" onclick="javascript:location.href='/student/list.do'"/>
        </div>
    </div>
    <script type="text/javascript" src="/static/bui/js/jquery-1.8.1.min.js"></script>
    <script type="text/javascript" src="/static/bui/js/bui.js"></script>
    <script type="text/javascript" src="/static/bui/js/config.js"></script>
    <script type="text/javascript" src="/static/js/cxdate.js"></script>
    <script type="text/javascript">
        BUI.use(['bui/grid', 'bui/data', 'bui/form'], function (Grid, Data, Form) {
            var columns = [
                        {title: '日期', dataIndex: 'name', width: '17%'},
                        {title: '付款信息', dataIndex: 'phone', width: '23%'},
                        {title: '付款金额', dataIndex: 'identityCard', width: '40%'},
                        {title: '收据号', dataIndex: 'identityCard', width: '40%'}
                    ],
            //默认的数据
                    data = [
                        <c:forEach items="${students}" var="r">
                        {
                            _id: '${r._id}',
                            name: '${r.name}',
                            phone: '${r.phone}',
                            identityCard: '${r.identityCard}'
                        },
                        </c:forEach>
                    ],
                    store = new Data.Store({
                        data: data,
                        pageSize: 10
                    }),
                    editing = new Grid.Plugins.DialogEditing({
                        contentId: 'content',
                        triggerCls: 'btn-edit',
                        editor: {
                            focusable: false,
                            success: function () {
                                var editType = editing.get('editType'),
                                        edtor = this,
                                        form = edtor.get("form");
                                form.valid();
                            }
                        }
                    }),
                    grid = new Grid.Grid({
                        render: '#grid',
                        columns: columns,
                        width: '100%',
//                    forceFit: true,
                        plugins: [Grid.Plugins.AutoFit],
                        store: store,
                        bbar: {
                            pagingBar: true,
                            elCls: 'image-pbar'
                        },
                        plugins: [Grid.Plugins.CheckSelection, editing],
                        tbar: {
                            items: []
                        }
                    })
            grid.render();

            var form = new Form.HForm({
                srcNode: '#J_Form'
            });
        });
    </script>
</div>
</body>
</html>